package com.neu.swc;

import com.neu.swc.dao.UserDao;
import com.neu.swc.service.UserService;
import com.neu.swc.service.impl.UserServiceImpl;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class BeanFactoryTest {
    public static void main(String[] args) {
        DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();

        XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(beanFactory);

        reader.loadBeanDefinitions("beans.xml");

        UserService userDao = (UserService) beanFactory.getBean("userService");

        System.out.println(userDao);





    }
}
